class Bullet extends Sprite {
  constructor(type) {
    if (type > 7 || type < 1) {
      throw new Error('炮弹的类型不对，范围为1到7。');
    }

    let bulletData = __g_resources.bullet[`bullet${type}`];
    super({
      image:   bulletData.image,
      sx:      bulletData.frame.x,
      sy:      bulletData.frame.y,
      w:       bulletData.frame.w,
      h:       bulletData.frame.h,
      speed:   10
    });
    this.type = type;
  }
}
